home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / printing / postscripthandledemo / printcomments.p < prev    next >
Encoding:
Text File  |  2000-06-23  |  5.4 KB  |  140 lines

  1. {
  2.     File:        PrintComments.p
  3.  
  4.     Contains:    
  5.  
  6.     Written by:     
  7.  
  8.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/26/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. }
  23.  
  24. UNIT PrintComments;
  25.     INTERFACE
  26. USES
  27.     Types;    
  28. CONST
  29. (*    Type                Kind    Data Size    Data Type        Description                                *)
  30.     TextBegin            = 150;    (*    6        TTxtPicRec        Begin text layout modifications            *)
  31.     TextEnd                = 151;    (*    0        NIL                End text layout modifications            *)
  32.     StringBegin            = 152;    (*    0        NIL                Begin segmented string                    *)
  33.     StringEnd            = 153;    (*    0        NIL                End segmented string                    *)
  34.     TextCenter            = 154;    (*    8        TTxtCenter        Specify center of rotation for            *) 
  35.                                 (*                            the TextBegin comment (above)            *)
  36.  
  37.     LineLayoutOff        = 155;    (*    0        NIL                Disable driver's line layout routine    *)    
  38.     LineLayoutOn        = 156;    (*    0        NIL                Enable driver's line layout routine        *)    
  39.     CustomLineLayout    = 157;    (*    16        LLCustom        Customize driver's line layout routine    *)
  40.  
  41.     PolyBegin            = 160;    (*    0        NIL                Begin PostScript polygon                *)    
  42.     PolyEnd                = 161;    (*    0        NIL                End PostScript polygon                    *)    
  43.     PolyIgnore            = 163;    (*    0        NIL                Ignore StdLine calls(for smoothed polys)*)    
  44.     PolySmooth            = 164;    (*    1        PolyVerb        Smooth a polygon using B-Splines        *)    
  45.     picPlyClo            = 165;    (*    0        NIL                Close an open polygon(connect start and    *)
  46.                                 (*                            end points                                *)
  47.  
  48.     DashedLine            = 180;    (*    -        TDashedLine        Begin PostScript line dashing            *)
  49.     DashedStop            = 181;    (*    0        NIL                End PostScript line dashing                *)
  50.     SetLineWidth        = 182;    (*    4        Point            Set hi resolution line width             *)    
  51.  
  52.     PostScriptBegin        = 190;    (*    0        NIL                Signal driver to ingnore Quickdraw calls*)
  53.     PostScriptEnd        = 191;    (*    0        NIL                Re-enable Quickdraw                        *)
  54.     PostScriptHandle    = 192;    (*    -        Handle            Transfer a block of PostScript            *)    
  55.     PostScriptFile        = 193;    (*    -        StringHandle    Transfer a file of PostScript            *)    
  56.     TextIsPostScript    = 194;    (*    0        NIL                Use DrawString to send PostScript        *)
  57.     ResourcePS            = 195;    (*    8        Type/ID/Index    Transfer a resource of PostScript        *)    
  58.  
  59.     RotateBegin            = 200;    (*    4        TRotation        Begin hi-resolution graphics rotation    *)    
  60.     RotateEnd            = 201;    (*    0        NIL                End rotation                            *)
  61.     RotateCenter        = 202;    (*    8        Center            Specify center of rotation                *)
  62.  
  63.     FormsPrinting        = 210;    (*    0        NIL                Specify graphics to remain resident        *)
  64.                                 (*                            for all pages in the print job            *)
  65.     EndFormsPrinting    = 211;    (*    0        NIL                Evict the residents                        *)
  66.  
  67.  
  68. TYPE
  69.  
  70. TTxtPicHdl = ^TTxtPicPtr;
  71. TTxtPicPtr = ^TTxtPicRec;
  72. TTxtPicRec = PACKED RECORD
  73.     tJus:    Byte;        (* Justification for line layout of text.                                *)
  74.     tFlip:    Byte;        (* Horizontal or vertical flipping                                        *)
  75.     tRot:    INTEGER;    (* Text rotation (0..360) (for fractional rot., see extTTxtPicRec below)*)
  76.     tLine:    Byte;        (* Single, 1 1/2, or double line spacing                                *)
  77.     tCmnt:    Byte;        (* Reserved                                                                *)
  78. END;
  79.  
  80. ExtTTxtPicHdl = ^ExtTTxtPicPtr;
  81. ExtTTxtPicPtr = ^ExtTTxtPicRec;
  82. ExtTTxtPicRec = PACKED RECORD
  83.     tJus:        Byte;    (* Justification for line layout of text                                *)
  84.     tFlip:        Byte;    (* Horizontal or vertical flipping                                        *)
  85.     tRot:        INTEGER;(* (Ignored)                                                            *)
  86.     tLine:        Byte;    (* Single, 1 1/2, or double line spacing                                *)
  87.     tCmnt:        Byte;    (* Reserved                                                                *)
  88.     tRotFixed:    Fixed;    (* Text rotation (0..360)                                                *)
  89. END;
  90.  
  91. TTxtCenterHdl = ^TTxtCenterPtr;
  92. TTxtCenterPtr = ^TTxtCenter;
  93. TTxtCenter = RECORD
  94.     y, x:    Fixed;        (* Offset from current pen location to center of rotation                *)
  95. END;
  96.  
  97. TPolyVerbHdl = ^TPolyVerbPtr;
  98. TPolyVerbPtr = ^TPolyVerb;
  99. TPolyVerb = PACKED RECORD
  100.     f7, f6, f5, f4,     (* Reserved                                                                *)
  101.     fPolyRes,             (* TRUE = Polygon was specified with doubled points                        *)
  102.     fPolyClose,         (* TRUE = Polygon should be closed                                        *)
  103.     fPolyFill,             (* TRUE = Polygon should be filled                                        *)
  104.     fPolyFrame:    BOOLEAN;(* TRUE = Polygon should be framed                                        *)
  105. END;
  106.  
  107. TDashedLineHdl = ^TDashedLinePtr;
  108. TDashedLinePtr = ^TDashedLine;
  109. TDashedLine = PACKED RECORD
  110.     offset:        SignedByte;                    (* Offset as specified by PostScript ???            *)
  111.     centered:    SignedByte;                    (* (Ignored) ???                                    *)
  112.     dashed:        ARRAY [0..0] OF SignedByte;    (* Dynamic array of dash intervals                    *)
  113. END;
  114.  
  115. PSRsrcHdl = ^PSRsrcPtr;
  116. PSRsrcPtr = ^PSRsrc;
  117. PSRsrc = RECORD
  118.     PSType:        ResType;    (* Resource type.  (Actual resource format is 'STR ' or 'STR#')        *)
  119.     PSID:        INTEGER;    (* Resource ID.                                                        *)
  120.     PSIndex:    INTEGER;    (* If PSType = 'STR ' then 0 otherwise index into 'STR#'.            *)
  121. END;
  122.  
  123. RotationHdl = ^RotationPtr;
  124. RotationPtr = ^Rotation;
  125. Rotation = RECORD
  126.     flip:        INTEGER;    (* Horizontal/vertical flipping (0=none,1=horizontal,2=vertical)    *)
  127.     angle:        INTEGER;    (* Clockwise rotation in degrees (0..360)                            *)
  128. END;
  129.  
  130. ExtRotationHdl = ^ExtRotationPtr;
  131. ExtRotationPtr = ^ExtRotation;
  132. ExtRotation = RECORD
  133.     flip:        INTEGER;    (* Horizontal/vertical flipping (0=none,1=horizontal,2=vertical)    *)
  134.     angle:        INTEGER;    (* (Ignored)                                                        *)
  135.     angleFixed:    Fixed;        (* Clockwise rotation in degrees (0..360)                            *)
  136. END;
  137.  
  138.  
  139. END.
  140.